home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Ken Long / Lightspeed-p-c / Symantec / Think C / fp.h next >
Encoding:
C/C++ Source or Header  |  1994-12-04  |  25.9 KB  |  653 lines  |  [TEXT/EDIT]

  1. /*******************************************************************************
  2. *                                                                              *
  3. *      File fp.h,- PowerPC version,                                            *
  4. *                                                                              *
  5. *      A collection of numerical functions designed to facilitate a wide       *
  6. *      range of numerical programming. It is modeled after the Floating-Point  *
  7. *      C Extensions (FPCE) proposed technical draft of the Numerical C         *
  8. *      Extensions Group's requirements (NCEG / X3J11.1).                       *
  9. *      The <fp.h> declares many functions in support of numerical programming. *
  10. *      It provides a superset of <math.h> and <sane.h> functions.  Some        *
  11. *      functionality previously found in <sane.h> and not in the FPCE <fp.h>   *
  12. *      can be found in this <fp.h> under the heading "__NOEXTENSIONS__".       *
  13. *                                                                              *
  14. *      All of these functions are IEEE 754 aware and treat exceptions, NaNs,   *
  15. *      positive and negative zero and infinity consistent with the floating-   *
  16. *      point standard.                                                         *
  17. *                                                                              *
  18. *      Copyright © 1992 Apple Computer, Inc.  All rights reserved.             *
  19. *                                                                              *
  20. *      Written by Ali Sazegari, started on July 1992,                          *
  21. *      based on the file Numerics.h by Jim Thomas.                             *
  22. *                                                                              *
  23. *      October    27  1992: made changes for PowerPC, transfered some power    *
  24. *                           functions to <faux.h>.                             *
  25. *      October    30  1992: added long double data type for PowerPC and        *
  26. *                           merged it with the Macintosh <fp.h>.               *
  27. *      December   10  1992: changed logb, scalb, frexp and ldexp to            *
  28. *                           LOGB, SCALB, FREXP and LDEXP to avoid collision    *
  29. *                           with the ibm libc.                                 *
  30. *      December   16  1992: changed the flag "powerpc" to "powerc"             *
  31. *      February   17  1993: removed the typedefs and defrerred them to         *
  32. *                           <Types.h>.                                         *
  33. *      May        18  1993: added binary to decimal conversions for the        *
  34. *                           PowerPC.                                           *
  35. *      June       14  1993: added the long double decimal conversions, changed *
  36. *                           the decimal conversion prototypes to double_t.     *
  37. *      July       11  1993: changed the names of the long double bin2dec.      *
  38. *      August     23  1993: included C++ extern "C" wrappers to make them C++  *
  39. *                           friendly.                                          *
  40. *                                                                              *
  41. *******************************************************************************/
  42.  
  43. #ifndef __FP__
  44. #define __FP__
  45.  
  46. /*      efficient types are included in Types.h.                              */
  47.  
  48. #ifndef __TYPES__
  49. #include <Types.h>
  50. #endif
  51.  
  52. /*******************************************************************************
  53. *                              Define some constants.                          *
  54. *******************************************************************************/
  55.  
  56. #ifdef      powerc
  57. #define      LONG_DOUBLE_SIZE            16
  58. #elif       mc68881
  59. #define      LONG_DOUBLE_SIZE            12
  60. #else
  61. #define      LONG_DOUBLE_SIZE            10
  62. #endif      /* powerc */
  63.  
  64. #define      DOUBLE_SIZE                  8      
  65.  
  66. //#define      HUGE_VAL                  __inf()
  67. #define      INFINITY                  __inf()
  68. #define      NAN                        nan("255")
  69.  
  70. /*    the macro DECIMAL_DIG is obtained by satisfying the constraint that the
  71.       conversion from double to decimal and back is the identity function.   */
  72.  
  73. #ifdef      powerc
  74. #define      DECIMAL_DIG                  36
  75. #else
  76. #define      DECIMAL_DIG                  21
  77. #endif      /* powerc */
  78.  
  79. #ifdef __cplusplus
  80. extern "C" {
  81. #endif
  82. /*******************************************************************************
  83. *                            Trigonometric functions                           *
  84. *******************************************************************************/
  85.  
  86. double_t cos ( double_t x );
  87. double_t sin ( double_t x );
  88. double_t tan ( double_t x );
  89.  
  90. double_t acos ( double_t x );            /*  argument x is in [0,pi]          */
  91. double_t asin ( double_t x );            /*  argument x is in [-pi/2,pi/2]    */
  92. double_t atan ( double_t x );            /*  argument x is in [-pi/2,pi/2]    */
  93.  
  94. #ifdef      powerc
  95. long double cosl ( long double x );
  96. long double sinl ( long double x );
  97. long double tanl ( long double x );
  98.  
  99. long double acosl ( long double x );      /*  argument x is in [0,pi]         */
  100. long double asinl ( long double x );      /*  argument x is in [-pi/2,pi/2]   */
  101. long double atanl ( long double x );      /*  argument x is in [-pi/2,pi/2]   */
  102. #endif      /* powerc */
  103.  
  104. /*    atan2 computes the arc tangent of y/x in [-pi,pi] using the sign of
  105.       both arguments to determine the quadrant of the computed value.         */
  106.  
  107. double_t atan2 ( double_t y, double_t x );
  108.  
  109. #ifdef      powerc
  110. long double atan2l ( long double y, long double x );
  111. #endif      /* powerc */
  112.  
  113. /*******************************************************************************
  114. *                              Hyperbolic functions                            *
  115. *******************************************************************************/
  116.  
  117. double_t cosh ( double_t x );
  118. double_t sinh ( double_t x );
  119. double_t tanh ( double_t x );
  120.  
  121. double_t acosh ( double_t x );
  122. double_t asinh ( double_t x );
  123. double_t atanh ( double_t x );
  124.  
  125. #ifdef      powerc
  126. long double coshl ( long double x );
  127. long double sinhl ( long double x );
  128. long double tanhl ( long double x );
  129.  
  130. long double acoshl ( long double x );
  131. long double asinhl ( long double x );
  132. long double atanhl ( long double x );
  133. #endif      /* powerc */
  134.  
  135. /*******************************************************************************
  136. *                              Exponential functions                           *
  137. *******************************************************************************/
  138.  
  139. double_t exp ( double_t x );
  140.  
  141. #ifdef      powerc
  142. long double expl ( long double x );
  143. #endif      /* powerc */
  144.  
  145. /*    expm1 computes the base e exponential of the argument minus 1,
  146.       i. e., exp(x) - 1.  For small enough arguments, expm1 is expected
  147.       to be more accurate than the straight forward computation of exp(x) - 1.*/
  148.  
  149. double_t expm1  ( double_t x );
  150.  
  151. #ifdef      powerc
  152. long double expm1l ( long double x );
  153. #endif      /* powerc */
  154.  
  155. /*      exp2 computes the base 2 exponential.                                 */
  156.  
  157. double_t exp2  ( double_t x );
  158.  
  159. double_t frexp ( double_t x, int *exponent );
  160. double_t ldexp ( double_t x, int n );
  161.  
  162. double_t log ( double_t x );
  163.  
  164. #ifdef      powerc
  165. long double exp2l  ( long double x );
  166.  
  167. long double frexpl ( long double x, int *exponent );
  168. long double ldexpl ( long double x, int n );
  169.  
  170. long double logl ( long double x );
  171. #endif      /* powerc */
  172.  
  173. /*      log2 computes the base 2 logarithm.                                   */
  174.  
  175. double_t log2 ( double_t x );
  176.  
  177. #ifdef      powerc
  178. long double log2l ( long double x );
  179. #endif      /* powerc */
  180.  
  181. /*    log1p computes the base e logorithm of 1 plus the argument,
  182.       i. e., log (1 x).  For small enough arguments, log1p is expected
  183.       to be more accurate than the straightforward computation of log (1+x).  */
  184.  
  185. double_t log1p ( double_t x );
  186. double_t log10 ( double_t x ); 
  187.  
  188. #ifdef      powerc
  189. long double log1pl ( long double x );
  190. long double log10l ( long double x ); 
  191. #endif      /* powerc */
  192.  
  193. /*      logb extracts the exponent of its argument, as a signed integral
  194.       value. A subnormal argument is treated as though it were first
  195.       normalized. Thus
  196.  
  197.       1 <= x * 2^( - Logb ( x ) ) < 2                                         */
  198.  
  199. double_t logb ( double_t x );
  200.  
  201. #ifdef      powerc
  202. long double logbl ( long double x );
  203. #endif      /* powerc */
  204.  
  205. long double modfl ( long double x, long double *iptrl );
  206. double      modf  ( double x, double *iptr );
  207. float       modff ( float x, float *iptrf );
  208.  
  209. /*    scalb computes x * 2^n efficently.  This is not normally done by
  210.       computing 2^n explicitly.                                               */
  211.  
  212. double_t scalb ( double_t x, long int n ); 
  213.  
  214. #ifdef      powerc
  215. long double scalbl ( long double x, long int n ); 
  216. #endif      /* powerc */
  217.  
  218. /*******************************************************************************
  219. *                     Power and absolute value functions                       *
  220. *******************************************************************************/
  221.  
  222. double_t fabs ( double_t x );
  223.  
  224. #ifdef      powerc
  225. long double fabsl ( long double x );
  226. #endif      /* powerc */
  227.  
  228. /*    hypot computes the square root of the sum of the squares of its
  229.       arguments, without undue overflow or underflow.                         */
  230.  
  231. double_t hypot ( double_t x, double_t y );
  232. double_t pow   ( double_t x, double_t y );
  233. double_t sqrt  ( double_t x );
  234.  
  235. #ifdef      powerc
  236. long double hypotl ( long double x, long double y );
  237. long double powl   ( long double x, long double y );
  238. long double sqrtl  ( long double x );
  239. #endif      /* powerc */
  240.  
  241. /*******************************************************************************
  242. *                        Gamma and Error functions                             *
  243. *******************************************************************************/
  244.  
  245. double_t erf  ( double_t x );            /*   the error function              */
  246. double_t erfc ( double_t x );            /*   complementary error function    */
  247.  
  248. double_t gamma ( double_t x );
  249.  
  250. #ifdef      powerc
  251. long double erfl  ( long double x );     /*   the error function              */
  252. long double erfcl ( long double x );     /*   complementary error function    */
  253.  
  254. long double gammal ( long double x );
  255. #endif      /* powerc */
  256.  
  257. /*    lgamma computes the base-e logarithm of the absolute value of
  258.       gamma of its argument x, for x > 0.                                     */
  259.  
  260. double_t lgamma ( double_t x );
  261.  
  262. #ifdef      powerc
  263. long double lgammal ( long double x );
  264. #endif      /* powerc */
  265.  
  266. /*******************************************************************************
  267. *                        Nearest integer functions                             *
  268. *******************************************************************************/
  269.  
  270. double_t ceil  ( double_t x );
  271. double_t floor ( double_t x ); 
  272.  
  273. #ifdef      powerc
  274. long double ceill  ( long double x );
  275. long double floorl ( long double x );
  276. #endif      /* powerc */
  277.  
  278. /*    the rint function rounds its argument to an integral value in floating
  279.       point format, honoring the current rounding direction.                  */
  280.  
  281. double_t rint ( double_t x );
  282.  
  283. #ifdef      powerc
  284. long double rintl ( long double x );
  285. #endif      /* powerc */
  286.  
  287. /*    nearbyint differs from rint only in that it does not raise the
  288.       inexact exception. It is the nearbyint function recommended by the
  289.       IEEE floating-point standard 854.                                       */
  290.  
  291. double_t nearbyint ( double_t x );
  292.  
  293. #ifdef      powerc
  294. long double nearbyintl ( long double x );
  295. #endif      /* powerc */
  296.  
  297. /*    the function rinttol rounds its argument to the nearest long int using
  298.       the current rounding direction.
  299.       >>Note that if the rounded value is outside the range of long int, then
  300.       the result is undefined.                                                */
  301.  
  302. long int rinttol ( double_t x );
  303.  
  304. #ifdef      powerc
  305. long int rinttoll ( long double x );
  306. #endif      /* powerc */
  307.  
  308. /*    the round function rounds the argument to the nearest integral value
  309.       in double format similar to the Fortran "anint" function.  That is:
  310.       add half to the magnitude and chop.                                     */
  311.  
  312. double_t round ( double_t x );
  313.  
  314. #ifdef      powerc
  315. long double roundl ( long double x );
  316. #endif      /* powerc */
  317.  
  318. /*    roundtol is similar to the Fortran function nint or to the Pascal round
  319.       >>Note that if the rounded value is outside the range of long int, then
  320.       the result is undefined.                                                */
  321.  
  322. long int roundtol ( double_t round );
  323.  
  324. #ifdef      powerc
  325. long int roundtoll ( long double round );
  326. #endif      /* powerc */
  327.  
  328. /*    trunc computes the integral value, in floating format, nearest to
  329.       but no larger in magnitude than its argument.                           */
  330.  
  331. double_t trunc ( double_t x );
  332.  
  333. #ifdef      powerc
  334. long double truncl ( long double x );
  335. #endif      /* powerc */
  336.  
  337. /*******************************************************************************
  338. *                            Remainder functions                               *
  339. *******************************************************************************/
  340.  
  341. double_t fmod ( double_t x, double_t y );
  342.  
  343. /*    the following two functions compute the remainder.  remainder is required
  344.       by the IEEE 754 floating point standard. The second form correponds to the
  345.       SANE remainder; it stores into 'quotient' the 7 low-order bits of the
  346.       integer quotient x/y, such that -127 <= quotient <= 127.                */
  347.  
  348. double_t remainder ( double_t x, double_t y );
  349. double_t remquo    ( double_t x, double_t y, int *quo );
  350.  
  351. #ifdef      powerc
  352. long double remainderl ( long double x, long double y );
  353. long double remquol    ( long double x, long double y, int *quo );
  354. #endif      /* powerc */
  355.  
  356. /*******************************************************************************
  357. *                             Auxiliary functions                              *
  358. *******************************************************************************/
  359.  
  360. /*    copysign produces a value with the magnitude of its first argument
  361.       and sign of its second argument. NOTE: the order of the arguments
  362.       matches the recommendation of the IEEE 754 floating point standard,
  363.       which is opposite from the SANE copysign function.                      */
  364.  
  365. double_t copysign ( double_t x, double_t y );
  366.  
  367. #ifdef      powerc
  368. long double copysignl ( long double x, long double y );
  369. #endif      /* powerc */
  370.  
  371. /*    the call 'nan ( "n-char-sequence" )' returns a quiet NaN with content
  372.       indicated through tagp in the selected data type format.                */
  373.  
  374. long double nanl ( const char *tagp );
  375. double      nan  ( const char *tagp );
  376. float       nanf ( const char *tagp );
  377.  
  378. /*    these compute the next representable value, in the type indicated,
  379.       after 'x' in the direction of 'y'.  if x == y then y is returned.       */
  380.  
  381. long double nextafterl ( long double x, long double y );
  382. double      nextafterd ( double x, double y );
  383. float       nextafterf ( float x, float y );
  384.  
  385. /*******************************************************************************
  386. *                              Inquiry macros                                  *
  387. *******************************************************************************/
  388.  
  389. enum NumberKind
  390.             {
  391.             FP_SNAN = 0,        /*      signaling NaN                         */
  392.             FP_QNAN,            /*      quiet NaN                             */
  393.             FP_INFINITE,        /*      + or - infinity                       */
  394.             FP_ZERO,            /*      + or - zero                           */
  395.             FP_NORMAL,          /*      all normal numbers                    */
  396.             FP_SUBNORMAL        /*      denormal numbers                      */
  397.             };
  398.  
  399. #define      fpclassify(x)    ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  400.                               __fpclassify  ( x ) :                            \
  401.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  402.                               __fpclassifyd ( x ) :                            \
  403.                               __fpclassifyf ( x ) )
  404.  
  405. /*    isnormal is non-zero if and only if the argument x is normalized.       */
  406.  
  407. #define      isnormal(x)      ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  408.                               __isnormal ( x ) :                               \
  409.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  410.                               __isnormald ( x ) :                              \
  411.                               __isnormalf ( x ) )
  412.  
  413. /*    isfinite is non-zero if and only if the argument x is finite.           */
  414.  
  415. #define      isfinite(x)      ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  416.                               __isfinite ( x ) :                               \
  417.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  418.                               __isfinited ( x ) :                              \
  419.                               __isfinitef ( x ) )
  420.  
  421. /*    isnan is non-zero if and only if the argument x is a NaN.               */
  422.  
  423. #define      isnan(x)         ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  424.                               __isnan ( x ) :                                  \
  425.                               ( sizeof ( x ) == DOUBLE_SIZE ) ?                \
  426.                               __isnand ( x ) :                                 \
  427.                               __isnanf ( x ) )
  428.  
  429. /*    signbit is non-zero if and only if the sign of the argument x is
  430.       negative. this includes, NaNs, infinities and zeros.                    */
  431.  
  432. #define      signbit(x)       ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  433.                               __signbit ( x ) :                                \
  434.                               ( sizeof ( x ) == DOUBLE_SIZE ) ?                \
  435.                               __signbitd ( x ) :                               \
  436.                               __signbitf ( x ) )
  437.  
  438. /*******************************************************************************
  439. *                      Max, Min and Positive Difference                        *
  440. *******************************************************************************/
  441.  
  442. /*    These extension functions correspond to the standard functions, dim
  443.       max and min.
  444.  
  445.       The fdim function determines the 'positive difference' between its
  446.       arguments: { x - y, if x > y }, { +0, if x <= y }.  If one argument is
  447.       NaN, then fdim returns that NaN.  if both arguments are NaNs, then fdim
  448.       returns the first argument.                                             */
  449.  
  450. double_t fdim ( double_t x, double_t y );
  451.  
  452. #ifdef      powerc
  453. long double fdiml ( long double x, long double y );
  454. #endif
  455.  
  456. /*    max and min return the maximum and minimum of their two arguments,
  457.       respectively.  They correspond to the max and min functions in FORTRAN.
  458.       NaN arguments are treated as missing data.  If one argument is NaN and
  459.       the other is a number, then the number is returned.  If both are NaNs
  460.       then the first argument is returned.                                    */
  461.  
  462. double_t fmax ( double_t x, double_t y );
  463. double_t fmin ( double_t x, double_t y );
  464.  
  465. #ifdef      powerc
  466. long double fmaxl ( long double x, long double y );
  467. long double fminl ( long double x, long double y );
  468. #endif
  469.  
  470. /*******************************************************************************
  471. *                                Constants                                     *
  472. *******************************************************************************/
  473.  
  474. extern const double_t pi;
  475.  
  476. /*******************************************************************************
  477. *                              Internal prototypes                             *
  478. *******************************************************************************/
  479.  
  480. long int __fpclassify  ( long double x ); 
  481. long int __fpclassifyd ( double x );
  482. long int __fpclassifyf ( float x );
  483.  
  484. long int __isnormal  ( long double x );
  485. long int __isnormald ( double x );
  486. long int __isnormalf ( float x );
  487.  
  488. long int __isfinite  ( long double x );
  489. long int __isfinited ( double x );
  490. long int __isfinitef ( float x );
  491.  
  492. long int __isnan  ( long double x );
  493. long int __isnand ( double x );
  494. long int __isnanf ( float x );
  495.  
  496. long int __signbit  ( long double x );
  497. long int __signbitd ( double x );
  498. long int __signbitf ( float x );
  499.  
  500. double __inf ( void );
  501.  
  502. /*******************************************************************************
  503. *                              Non NCEG extensions                             *
  504. *******************************************************************************/
  505.  
  506. #ifndef __NOEXTENSIONS__
  507.  
  508. /*******************************************************************************
  509. *                              Financial functions                             *
  510. *******************************************************************************/
  511.  
  512. /*    compound computes the compound interest factor "(1 + rate) ^ periods"
  513.       more accurately than the straightforward computation with the Power
  514.       function.  This is SANE's compound function.                            */
  515.  
  516. double_t compound ( double_t rate, double_t periods );
  517.  
  518. /*    The function annuity computes the present value factor for an annuity 
  519.       "( 1 - ( 1 + rate ) ^ ( - periods ) ) / rate" more accurately than the
  520.       straightforward computation with the Power function. This is SANE's 
  521.       annuity function.                                                       */
  522.  
  523. double_t annuity ( double_t rate, double_t periods );
  524.  
  525. /*******************************************************************************
  526. *                              Random function                                 *
  527. *******************************************************************************/
  528.  
  529. double_t randomx ( double_t *x );
  530.  
  531. /*******************************************************************************
  532. *                              Relational operator                             *
  533. *******************************************************************************/
  534.  
  535. typedef short relop;                         /*      relational operator      */
  536.  
  537. enum 
  538.       {
  539.       GREATERTHAN = ( ( relop ) ( 0 ) ),
  540.       LESSTHAN,
  541.       EQUALTO,
  542.       UNORDERED
  543.       };
  544.  
  545. relop relation ( double_t x, double_t y );
  546.  
  547. #ifdef      powerc
  548. relop relationl ( long double x, long double y );
  549. #endif      /* powerc */
  550.  
  551. /*******************************************************************************
  552. *                            Data exchange routines                            *
  553. *******************************************************************************/
  554.  
  555. #ifdef      powerc
  556. void x80told ( const extended80 *x80, long double *x );
  557. void ldtox80 ( const long double *x, extended80 *x80 );
  558. #endif      /* powerc */
  559.  
  560. /*******************************************************************************
  561. *                         Binary to decimal conversions                        *
  562. *******************************************************************************/
  563.  
  564. #define      SIGDIGLEN      36               /*    significant decimal digits */
  565. #define      DECSTROUTLEN   80               /* max length for dec2str output */
  566. #define      FLOATDECIMAL   ((char)(0))
  567. #define      FIXEDDECIMAL   ((char)(1))
  568.  
  569. /*    The decimal record type provides an intermediate unpacked form for
  570.       programmers who wish to do their own parsing of numeric input or
  571.       formatting of numeric output.                                           */
  572.     
  573. struct decimal 
  574.      {
  575.       char sgn;                              /*         sign 0 for +, 1 for - */
  576.       char unused;
  577.       short exp;                             /*              decimal exponent */
  578.       struct
  579.             {
  580.             unsigned char length;
  581.             unsigned char text[SIGDIGLEN];   /*            significant digits */
  582.             unsigned char unused;
  583.             }sig;
  584.       };
  585.  
  586. typedef struct decimal decimal;
  587.  
  588. /*    Each conversion to a decimal string is controlled by a decform
  589.       structure.  The style is either FLOATDECIMAL or FIXEDDECIMAL defined
  590.       above.  The value of digits is the number of significant digits for
  591.       FLOATDECIMAL.  The value of digits for FIXEDDECIMAL is the number of
  592.       digits to the right of the decimal point.                               */
  593.  
  594. struct decform 
  595.       {
  596.       char style;                            /*  FLOATDECIMAL or FIXEDDECIMAL */
  597.       char unused;
  598.       short digits;
  599.       };
  600.  
  601. typedef struct decform decform;
  602.  
  603. /*    Each conversion to a decimal record d via the function call num2dec is 
  604.       controlled by a decform record f (defined earlier), to a double_t x.    */
  605.  
  606. void num2dec ( const decform *f, double_t x, decimal *d );
  607.  
  608. /*    Each conversion to a decimal record d via the function call num2decl is 
  609.       controlled by a decform record f (defined earlier), to a long double x. */
  610.  
  611. #ifdef      powerc
  612. void num2decl ( const decform *f, long double x, decimal *d );
  613. #endif      /* powerc */
  614.  
  615. /*    dec2num converts a decimal record d to a double_t value.                */
  616.  
  617. double_t dec2num ( const decimal *d );
  618.  
  619. /*    The MathLib formatter dec2str is controlled by a decform f.  Input d is
  620.       a decimal record.                                                       */
  621.  
  622. void dec2str ( const decform *f, const decimal *d, char *s );
  623.  
  624. /*    The function str2dec is the MathLib scanner.                            */
  625.  
  626. void str2dec ( const char *s, short *ix, decimal *d, short *vp ); 
  627.  
  628. /*    dec2numl is similar to dec2num except a long double is returned.      */
  629.  
  630. #ifdef      powerc
  631. long double dec2numl ( const decimal *d );
  632. #endif      /* powerc */
  633.  
  634. /*    dec2f is similar to dec2num except a float is returned.                 */
  635.  
  636. float dec2f ( const decimal *d );
  637.  
  638. /*    dec2s is similar to dec2num except a short is returned.                 */
  639.  
  640. short int dec2s ( const decimal *d );
  641.  
  642. /*    dec2l is similar to dec2num except a long is returned.                  */
  643.  
  644. long int dec2l  ( const decimal *d );
  645.  
  646. #endif      /* __NOEXTENSIONS__ */
  647.  
  648. #ifdef __cplusplus
  649. }
  650. #endif
  651.  
  652. #endif 
  653.